home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / comm / xeno / bgbbs06.lha / BGBBS.REXX < prev    next >
Encoding:
OS/2 REXX Batch file  |  1998-07-25  |  29.5 KB  |  1,228 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*  BGBBS.REXX  -  Oh well Xenolink is in need of a new BBS lister so here  */
  4. /*      V0.6       it is. As XBBSLister hasn't been updated in yonks I      */
  5. /* 21st July 98    thought I'd knock a new BBS lister up, hope you like it. */
  6. /*                                                                          */
  7. /* (C)1998 Ben Gaunt Sysop: Channel X BBS +44 (0)181 943 5187               */
  8. /*                    (AKA: BenG OR Madness on IRC)                         */
  9. /*                    Fido: 2:254/260.12                                    */
  10. /*                  e-mail: ben.gaunt@pickled.demon.co.uk                   */
  11. /*                                                                          */
  12. /* NEEDS:  T: to be assigned  (assign T: RAM:T) its in most start ups ;)    */
  13. /*                                                                          */
  14. /****************************************************************************/
  15.  
  16. /* Arguments:   BGBBS.REXX [NODE_NUMBER] */
  17.  
  18. /*************************************************************************/
  19. /* I BEN GAUNT THE PROGRAMER OF THIS BBS LISTER REQUESTS THAT YOU DO NOT */
  20. /* ALTER THE LINE DISPLAYING MY BBS NUMBER. AFTER ALL THIS DOOR IS       */
  21. /* FREEWARE AND IT WOULD BE NICE FOR ME TO GET A REWARD OF A FEW NEW     */
  22. /* USERS FOR MY TROUBLES. BUT IF YOU REALY DONT WANT TO HAVE MY NUMBER   */
  23. /* THERE FEEL FREE TO REMOVE IT, IT WOULD BE NICE IF YOU WOULD KEEP IT   */
  24. /* THERE THOUGH ;)                                                       */
  25. /*************************************************************************/
  26.  
  27. OPTIONS RESULTS
  28. arg Node_Number
  29. Signal on error
  30. signal on syntax
  31. signal on IOERR
  32. PortName = 'XenolinkRexxPort'Node_Number
  33. GetUserVar Name
  34. nicename result
  35. uname$ = result
  36. GetUserVar Privilege
  37. alevel = result
  38.  
  39. GetUserVar PageLength
  40. plength = result
  41. dplength = plength - 8
  42.  
  43. GetUserVar MenuSet
  44. menuset=result
  45.  
  46. /* ======================================================================== */
  47. /*  <<< CONFIGURATION >>>   <<< CONFIGURATION >>>   <<< CONFIGURATION >>>   */
  48. /* ======================================================================== */
  49.  
  50. /* THE VALUE [0] BELOW SHOULD BE = TO FIRST MENUSET TO USE ANSI COLOUR */
  51. /* 1 = USE ANSI + COLOUR, 0 = USE ASCII TEXT */
  52.  
  53. if menuset > 0 then do
  54.  _ANSI = 1
  55. end
  56. else do
  57.  _ANSI = 0
  58. end
  59.  
  60.  
  61. /* IF YOU WANT BGBBS IN A DIFFERENT LOCATION CHANGE THE PATH$ TO POINT TO */
  62. /* THE NEW PATH. <<< IMPORTANT >>> THE PATH$ MUST END IN A : OR /         */
  63.  
  64. PATH$="REXX:BGBBS/"
  65.  
  66. /* ======================================================================== */
  67. /*        <<< END CONFIGURATION >>>       <<< END CONFIGURATION >>>         */
  68. /* ======================================================================== */
  69.  
  70. /* SET UP EASY COLOURS ;) */
  71.  RED=''
  72.  GRE=''
  73.  YEL=''
  74.  BLU=''
  75.  PUR=''
  76.  CYA=''
  77.  OFF=''
  78.  
  79. /* ======================================================================== */
  80.  
  81. CLS
  82. message 'Loading BBS data, please wait a moment....'
  83.  
  84. call DATLOAD
  85.  
  86. /* ======================================================================== */
  87.  
  88. MAINMENU:
  89.  
  90. do forever
  91.  
  92.   call BANNER
  93.  
  94.   if _ANSI = 1 then do
  95.     newline
  96.     message RED'                          ['OFF'1'RED']'OFF' View the BBS list'
  97.     message RED'                          ['OFF'2'RED']'OFF' Search BBS list'
  98.     message RED'                          ['OFF'3'RED']'OFF' Download BBS list (ASCII TEXT)'
  99.     message RED'                          ['OFF'4'RED']'OFF' Add a BBS to the list'
  100.     message RED'                          ['OFF'5'RED']'OFF' Edit a BBS on the list'
  101.     message RED'                          ['OFF'6'RED']'OFF' Delete a BBS from the list'
  102.     message RED'                          ['OFF'7'RED']'OFF' Help'
  103.     newline
  104.     message RED'                          ['OFF'8'RED']'OFF' Exit'
  105.     newline
  106.   end
  107.   else do
  108.     newline
  109.     message '                          [1] View the BBS list'
  110.     message '                          [2] Search BBS list'
  111.     message '                          [3] Download BBS list (ASCII TEXT)'
  112.     message '                          [4] Add a BBS to the list'
  113.     message '                          [5] Edit a BBS on the list'
  114.     message '                          [6] Delete a BBS from the list'
  115.     message '                          [7] Help'
  116.     newline
  117.     message '                          [8] Exit'
  118.     newline
  119.   end
  120.  
  121.   msg '                            The choice is yours> '
  122.  
  123.   do until choice >0 & choice <9
  124.     getchar
  125.     choice=result
  126.   end
  127.  
  128.   if choice = 1 then do
  129.     call VIEWLIST
  130.   end
  131.  
  132.   if choice = 2 then do
  133.     call SEARCH
  134.   end
  135.  
  136.   if choice = 3 then do
  137.     call DOWN
  138.   end
  139.  
  140.   if choice = 4 then do
  141.     call NEWBBS
  142.   end 
  143.  
  144.   if choice = 5 then do
  145.     call EDIT
  146.   end  
  147.  
  148.   if choice = 6 then do
  149.     call KILL
  150.   end
  151.  
  152.   if choice = 7 then do
  153.     call HELP
  154.   end
  155.  
  156.   if choice = 8 then do
  157.     CLS
  158.     exitscript
  159.   end
  160.  
  161. end
  162.  
  163. /* ======================================================================== */
  164.  
  165. NEWBBS:
  166.  
  167. call BANNER
  168. newline
  169. /* GET BBS DETAILS */
  170. n=totalBBS+1
  171. if _ANSI = 1 then do
  172.   msg GRE'           BBS name:'OFF
  173.   getline 58 normal ' '
  174.   BBS$.n.1 = result
  175.  
  176.   msg GRE'   Telephone number:'OFF
  177.   getline 58 normal ' '
  178.   BBS$.n.2 = result
  179.  
  180.   msg GRE'         Open hours:'OFF
  181.   getline 58 normal ' '
  182.   BBS$.n.3 = result
  183.  
  184.   msg GRE'      Max baud rate:'OFF
  185.   getline 58 normal ' '
  186.   BBS$.n.4 = result
  187.  
  188.   msg GRE'           Location:'OFF
  189.   getline 58 normal ' '
  190.   BBS$.n.5 = result
  191.  
  192.   msg GRE'       BBS Software:'OFF
  193.   getline 58 normal ' '
  194.   BBS$.n.6 = result
  195.  
  196.   msg GRE'       Sysop''s name:'OFF
  197.   getline 58 normal ' '
  198.   BBS$.n.7 = result
  199.  
  200.   msg GRE'      Mail Networks:'OFF
  201.   getline 58 normal ' '
  202.   BBS$.n.8 = result
  203.  
  204.   msg GRE'        Net address:'OFF
  205.   getline 58 normal ' '
  206.   BBS$.n.9 = result
  207.  
  208.   msg GRE'      Email address:'OFF
  209.   getline 58 normal ' '
  210.   BBS$.n.10 = result
  211.  
  212.   msg GRE'Computers supported:'OFF
  213.   getline 58 normal ' '
  214.   BBS$.n.11 = result
  215.  
  216.   msg GRE'      Comment (1/3):'OFF
  217.   getline 58 normal ' '
  218.   BBS$.n.12 = result
  219.  
  220.   msg GRE'      Comment (2/3):'OFF
  221.   getline 58 normal ' '
  222.   BBS$.n.13 = result
  223.  
  224.   msg GRE'      Comment (3/3):'OFF
  225.   getline 58 normal ' '
  226.   BBS$.n.14 = result
  227.  
  228.   message GRE'               Date: 'RED||date()||OFF
  229.   BBS$.n.15 = date()
  230. end
  231. else do
  232.   msg '           BBS name:'
  233.   getline 58 normal ' '
  234.   BBS$.n.1 = result
  235.  
  236.   msg '   Telephone number:'
  237.   getline 58 normal ' '
  238.   BBS$.n.2 = result
  239.  
  240.   msg '         Open hours:'
  241.   getline 58 normal ' '
  242.   BBS$.n.3 = result
  243.  
  244.   msg '      Max baud rate:'
  245.   getline 58 normal ' '
  246.   BBS$.n.4 = result
  247.  
  248.   msg '           Location:'
  249.   getline 58 normal ' '
  250.   BBS$.n.5 = result
  251.  
  252.   msg '       BBS Software:'
  253.   getline 58 normal ' '
  254.   BBS$.n.6 = result
  255.  
  256.   msg '       Sysop''s name:'
  257.   getline 58 normal ' '
  258.   BBS$.n.7 = result
  259.  
  260.   msg '      Mail Networks:'
  261.   getline 58 normal ' '
  262.   BBS$.n.8 = result
  263.  
  264.   msg '        Net address:'
  265.   getline 58 normal ' '
  266.   BBS$.n.9 = result
  267.  
  268.   msg '      Email address:'
  269.   getline 58 normal ' '
  270.   BBS$.n.10 = result
  271.  
  272.   msg 'Computers supported:'
  273.   getline 58 normal ' '
  274.   BBS$.n.11 = result
  275.  
  276.   msg '      Comment (1/3):'
  277.   getline 58 normal ' '
  278.   BBS$.n.12 = result
  279.  
  280.   msg '      Comment (2/3):'
  281.   getline 58 normal ' '
  282.   BBS$.n.13 = result
  283.  
  284.   msg '      Comment (3/3):'
  285.   getline 58 normal ' '
  286.   BBS$.n.14 = result
  287.  
  288.   message '               Date: 'date()
  289.   BBS$.n.15 = date()
  290. end
  291.  
  292. QUERYN 'Is all the above correct?'
  293. yn$ = result
  294.  
  295. /* IF DATA IS CORRECT ADD IT TO THE BBS LIST DAT FILE */
  296. if yn$ = 'Y' then do
  297.  
  298.   BBS$.n.16 = uname$
  299.   totalBBS=totalBBS+1
  300.  
  301.   newline
  302.   msg 'Adding BBS details to the BBS list......'
  303.   call open(datafile, PATH$||'BGBBS.DAT', 'a')
  304.     call writeln(datafile, BBS$.n.1)
  305.     call writeln(datafile, BBS$.n.2)
  306.     call writeln(datafile, BBS$.n.3)
  307.     call writeln(datafile, BBS$.n.4)
  308.     call writeln(datafile, BBS$.n.5)
  309.     call writeln(datafile, BBS$.n.6)
  310.     call writeln(datafile, BBS$.n.7)
  311.     call writeln(datafile, BBS$.n.8)
  312.     call writeln(datafile, BBS$.n.9)
  313.     call writeln(datafile, BBS$.n.10)
  314.     call writeln(datafile, BBS$.n.11)
  315.     call writeln(datafile, BBS$.n.12)
  316.     call writeln(datafile, BBS$.n.13)
  317.     call writeln(datafile, BBS$.n.14)
  318.     call writeln(datafile, BBS$.n.15)
  319.     call writeln(datafile, BBS$.n.16)
  320.   call close(datafile)
  321.   msg 'done.'
  322. end
  323. /* IF DATA ISNT CORRECT INFORM USER DATA HASNT BEEN ADDED TO THE LIST */
  324. else do
  325.   newline
  326.   message 'Entry aborted BBS details have NOT been added to the list.'
  327.   newline
  328.   msg 'Press any key to continue.'
  329.   getchar
  330. end
  331.  
  332. return
  333.  
  334. /* ======================================================================== */
  335.  
  336. VIEWLIST:
  337.  
  338. call BANNER
  339.  
  340. if _ANSI = 1 then do
  341.   newline
  342.   message GRE'Would you like to see a 'RED'['OFF'S'RED']'GRE'hort quick list or a 'RED'['OFF'F'RED']'GRE'ull detailed list?'OFF
  343.   newline
  344.   msg RED'['OFF's'RED']'GRE'hort/'RED'['OFF'F'RED']'GRE'ull > 'OFF
  345. end
  346. else do
  347.   newline
  348.   message 'Would you like to see a [S]hort quick list or a [F]ull detailed list?'
  349.   newline
  350.   msg '[s]hort/[F]ull > '
  351. end
  352.  
  353. getchar
  354. lview$=result
  355. lview$=upper(lview$)
  356.  
  357. if lview$ = 'S' then do
  358. /* SHORT LISTER */
  359.  
  360.   pause = (plength-8)/5
  361.  
  362. /* do n=1 to totalBBS */
  363. n=0
  364. do until n >= totalBBS
  365.     call banner
  366.     counter = 0
  367.  
  368.     /* KEEP PRINTING THE BBS DATA UNTIL SCREEN IS FULL OR END OF FILE */
  369.     /* HAS BEEN REACHED */
  370.     /* THIS IS VERY VERY VERY MESSY :-/ */
  371.     do until counter >= pause-1 | n = totalBBS
  372.  
  373.       newline
  374.       counter = counter +1
  375.       n=n+1
  376.  
  377.       if _ANSI = 1 then do
  378.         message GRE'           BBS name: 'YEL||BBS$.n.1
  379.         message GRE'   Telephone number: 'OFF||BBS$.n.2
  380.         message GRE'         Open hours: 'OFF||BBS$.n.3
  381.         message GRE'Computers supported: 'OFF||BBS$.n.11
  382.       end
  383.       else do
  384.         message '           BBS name: '||BBS$.n.1
  385.         message '   Telephone number: '||BBS$.n.2
  386.         message '         Open hours: '||BBS$.n.3
  387.         message 'Computers supported: '||BBS$.n.11
  388.       end
  389.     end
  390.  
  391.     newline
  392.     msg '                  Press any key to continue or press Q to quit'
  393.     getchar
  394.     choice$=result
  395.     upper choice$
  396.     if choice$ = 'Q' then do
  397.       n=totalBBS
  398.     end
  399.  
  400.   end
  401.  
  402. end
  403. else do
  404.   /* FULL LISTER */
  405.   do n=1 to totalBBS
  406.     /* DISPLAY THE RECENTLY READ IN DATA */
  407.  
  408.     call banner
  409.  
  410.     /* DISPLAY THE BBS DETAILS */
  411.     call DISPLAYBBS(n)
  412.  
  413.     /* LINE 16 ISNT SHOWN USED IN DEL OPTION */
  414.     
  415.     newline
  416.     msg '                  Press any key to continue or press Q to quit'
  417.     getchar
  418.     choice$=result
  419.     upper choice$
  420.     if choice$ = 'Q' then do
  421.       n=totalBBS
  422.     end
  423.  
  424.   end
  425.  
  426. end
  427.  
  428. return
  429.  
  430. /* ======================================================================== */
  431.  
  432. DOWN:
  433.  
  434. call BANNER
  435. newline
  436. message 'Generating ASCII text file from the BBS lister data, please wait...'
  437. newline
  438.  
  439. call open(introdata, PATH$||'INTRO.TXT', 'R')
  440. call open(enddata, PATH$||'END.TXT', 'R')
  441.  
  442. call open(ASCII, 'T:BBS_LIST.TXT', 'W')
  443.  
  444. /* COPY INTRO TEXT TO ASCII FILE */
  445. do until eof(introdata)
  446.   aline$ = readln(introdata)
  447.   call writeln(ASCII, aline$)
  448. end
  449.  
  450. /* WRITE BBS LIST TO ASCII FILE */
  451. do n=1 to totalBBS
  452.   call writeln(ASCII, '           BBS name: '||BBS$.n.1)
  453.   call writeln(ASCII, '   Telephone number: '||BBS$.n.2)
  454.   call writeln(ASCII, '         Open hours: '||BBS$.n.3)
  455.   call writeln(ASCII, '      Max baud rate: '||BBS$.n.4)
  456.   call writeln(ASCII, '           Location: '||BBS$.n.5)
  457.   call writeln(ASCII, '       BBS Software: '||BBS$.n.6)
  458.   call writeln(ASCII, '       Sysop''s name: '||BBS$.n.7)
  459.   call writeln(ASCII, '      Mail Networks: '||BBS$.n.8)
  460.   call writeln(ASCII, '        Net address: '||BBS$.n.9)
  461.   call writeln(ASCII, '      Email address: '||BBS$.n.10)
  462.   call writeln(ASCII, 'Computers supported: '||BBS$.n.11)
  463.   call writeln(ASCII, '            Comment: '||BBS$.n.12)
  464.   call writeln(ASCII, '                     '||BBS$.n.13)
  465.   call writeln(ASCII, '                     '||BBS$.n.14)
  466.   call writeln(ASCII, 'Date placed on list: '||BBS$.n.15)
  467.   call writeln(ASCII, '')
  468.   call writeln(ASCII, '----------------------------------------------------------------------------')
  469.   call writeln(ASCII, '')
  470. end
  471.  
  472. /* COPY END TEXT TO ASCII FILE */
  473. do until eof(enddata)
  474.   aline$ = readln(enddata)
  475.   call writeln(ASCII, aline$)
  476. end
  477.  
  478. /* TAG IT ;) */
  479. call writeln(ASCII, '          .----------------------------------------------------------.')
  480. call writeln(ASCII, '          | This file was created with BG-BBS LISTER ©1998 Ben Gaunt |')
  481. call writeln(ASCII, '          |         Another Pickled Fish Software Production!        |')
  482. call writeln(ASCII, '          `----------------------------------------------------------''')
  483.  
  484. call close (ASCII)
  485. call close (introdata)
  486. call close (enddata)
  487.  
  488.   DOWNLOADFILE 'T:BBS_LIST.TXT'
  489.   dl = result
  490.  
  491.   if dl = 1 then do
  492.     message 'Download failed, local download not allowed!'
  493.   end   
  494.  
  495.   if dl = 2 then do
  496.     message 'Download failed, file does not exist?'
  497.   end
  498.  
  499.   if dl = 3 then do
  500.     message 'File already marked for downloading!'
  501.     startdownload 1
  502.   end
  503.  
  504. newline
  505. msg 'Press any key to continue'
  506. getchar
  507.  
  508. return
  509.  
  510. /* ======================================================================== */
  511.  
  512. SEARCH:
  513.  
  514. call banner
  515.  
  516. newline
  517. if _ANSI=1 then do
  518.   Message RED'Warning if there are a lot of records this may take some time!'
  519.   newline
  520.   Msg GRE'Search for? > '
  521. end
  522. else do
  523.   Message 'Warning if there are a lot of records this may take some time!'
  524.   newline
  525.   newline
  526.   Msg 'Search for? > '
  527. end
  528.  
  529. getline 58 normal
  530. findme$ = result
  531. upper findme$
  532.  
  533. if length(findme$) > 0 then do
  534.  
  535.   /* TOTAL BBS SEARCH */
  536.   do n = 1 to totalBBS
  537.  
  538.     /* RESET THE FOUND FLAG */
  539.     found = 0
  540.  
  541.     newline
  542.     msg 'Searching '||BBS$.n.1' details'
  543.  
  544.     /* FIELDS OF BBS SEARCH */
  545.     do f =1 to 16
  546.  
  547.  
  548.       /* CHECK FOR MATCH */
  549.       foundit$ = upper(BBS$.n.f)
  550.       z=length(foundit$)
  551.       x=length(findme$)
  552.  
  553.       do i = 1 to z
  554.         itsme$ = substr(foundit$,i,x)
  555.  
  556.         if itsme$ = findme$ then do
  557.           found=1
  558.         end
  559.  
  560.       end
  561.  
  562.  
  563.       /* DISPLAY BBS DETAILS IF A MATCH IS FOUND */
  564.       if found = 1 then do
  565.  
  566.         /* END THE FIELD SEARCH */
  567.         f=16
  568.  
  569.         call banner
  570.         newline
  571.         call DISPLAYBBS(n)
  572.         newline
  573.  
  574.         msg '                  Press any key to continue or press Q to quit'
  575.         getchar
  576.         quiter$=result
  577.         upper quiter$
  578.         if quiter$ = 'Q' then do
  579.           n = totalBBS
  580.         end
  581.         else do
  582.           CLS
  583.           call BANNER
  584.         end
  585.       end
  586.  
  587.     end
  588.  
  589.   end
  590.  
  591. end
  592.  
  593. Newline
  594. Newline
  595. if _ANSI=1 then do
  596.   Msg GRE'Search finished - press any key'
  597. end
  598. else do
  599. Msg 'Search finished - press any key'
  600. end
  601. getchar
  602.  
  603. return
  604.  
  605. /* ======================================================================== */
  606.  
  607. KILL:
  608.  
  609. call banner
  610. newline
  611.  
  612. do n=1 to totalBBS
  613.  
  614.   /* SEE IF USER WISHING TO DELETE HAS ENTERD ANYTHING */
  615.   if BBS$.n.16 = uname$ | alevel = 255 then do
  616.  
  617.     call displaybbs(n)
  618.     newline
  619.     QUERYN 'Delete this BBS record? '
  620.     killme = upper(result)
  621.     
  622.     if killme = 'Y' then do
  623.       
  624.       newline
  625.       msg 'Removing BBS details from list pleas wait...'
  626.    
  627.       call open(datafile, PATH$||'BGBBS.DAT', 'W')
  628.       do a=1 to totalBBS
  629.  
  630.         if a ~= n then do
  631.           call writeln(datafile, BBS$.a.1)
  632.           call writeln(datafile, BBS$.a.2)
  633.           call writeln(datafile, BBS$.a.3)
  634.           call writeln(datafile, BBS$.a.4)
  635.           call writeln(datafile, BBS$.a.5)
  636.           call writeln(datafile, BBS$.a.6)
  637.           call writeln(datafile, BBS$.a.7)
  638.           call writeln(datafile, BBS$.a.8)
  639.           call writeln(datafile, BBS$.a.9)
  640.           call writeln(datafile, BBS$.a.10)
  641.           call writeln(datafile, BBS$.a.11)
  642.           call writeln(datafile, BBS$.a.12)
  643.           call writeln(datafile, BBS$.a.13)
  644.           call writeln(datafile, BBS$.a.14)
  645.           call writeln(datafile, BBS$.a.15)
  646.           call writeln(datafile, BBS$.a.16)
  647.         end
  648.  
  649.       end
  650.  
  651.       call close(datafile)
  652.       call DATLOAD
  653.       /* RESET FOR DO POINTER */
  654.       n=n-1
  655.  
  656.     end
  657.  
  658.     call banner
  659.     newline
  660.  
  661.   end
  662.  
  663. end
  664.  
  665. message 'There are no more BBS records that can be deleted by you.'
  666. newline
  667. message 'If there is a BBS record on here you wish removed please leave a message'
  668. message 'to the Sysop he/she can remove it for you.'
  669. newline
  670. msg 'Press any key to continue'
  671. getchar
  672.  
  673. return
  674.  
  675. /* ======================================================================== */
  676.  
  677. EDIT:
  678.  
  679. do n=1 to totalBBS                                       
  680.  
  681. call BANNER
  682. newline 
  683.  
  684.   /* SEE IF USER WISHING TO EDIT HAS ENTERD ANYTHING */
  685.   if BBS$.n.16 = uname$ | alevel = 255 then do
  686.     abort='N'
  687.     call displaybbs(n)
  688.     newline
  689.     QUERYN 'Edit this BBS record? '
  690.     edme = upper(result)
  691.     
  692.     if edme = 'Y' then do
  693.  
  694.     do until abort='Y'
  695.       call banner
  696.       newline
  697.       newline
  698.  
  699.       if _ANSI = 1 then do
  700.         message YEL'1'GRE'          BBS name: 'YEL||BBS$.n.1
  701.         message YEL'2'GRE'  Telephone number: 'OFF||BBS$.n.2
  702.         message YEL'3'GRE'        Open hours: 'OFF||BBS$.n.3
  703.         message YEL'4'GRE'     Max baud rate: 'OFF||BBS$.n.4
  704.         message YEL'5'GRE'          Location: 'OFF||BBS$.n.5
  705.         message YEL'6'GRE'      BBS Software: 'OFF||BBS$.n.6
  706.         message YEL'7'GRE'      Sysop''s name: 'OFF||BBS$.n.7
  707.         message YEL'8'GRE'     Mail Networks: 'OFF||BBS$.n.8
  708.         message YEL'9'GRE'       Net address: 'OFF||BBS$.n.9
  709.         message YEL'10'GRE'    Email address: 'OFF||BBS$.n.10
  710.         message YEL'11'GRE'Compu''s supported: 'OFF||BBS$.n.11
  711.         message YEL'12'GRE'          Comment: 'CYA||BBS$.n.12
  712.         message YEL'13'GRE'                   'CYA||BBS$.n.13
  713.         message YEL'14'GRE'                   'CYA||BBS$.n.14
  714.         message GRE'Date placed on list: 'RED||BBS$.n.15||OFF
  715.       end
  716.       else do
  717.         message '1          BBS name: '||BBS$.n.1
  718.         message '2  Telephone number: '||BBS$.n.2
  719.         message '3        Open hours: '||BBS$.n.3
  720.         message '4     Max baud rate: '||BBS$.n.4
  721.         message '5          Location: '||BBS$.n.5
  722.         message '6      BBS Software: '||BBS$.n.6
  723.         message '7      Sysop''s name: '||BBS$.n.7
  724.         message '8     Mail Networks: '||BBS$.n.8
  725.         message '9       Net address: '||BBS$.n.9
  726.         message '10    Email address: '||BBS$.n.10
  727.         message '11 Comp''s supported: '||BBS$.n.11
  728.         message '12          Comment: '||BBS$.n.12
  729.         message '13                   '||BBS$.n.13
  730.         message '14                   '||BBS$.n.14
  731.         message 'Date placed on list: '||BBS$.n.15
  732.       end
  733.  
  734.       newline
  735.       msg 'Enter number of line to Edit, [S]ave & exit, [A]bort> '
  736.       getline 3 normal ''
  737.       ln=upper(result)
  738.  
  739.       /* SAVE UPDATED DATA */
  740.       if ln='S' then do
  741.  
  742.       call open(datafile, PATH$||'BGBBS.DAT', 'W')
  743.  
  744.       do a=1 to totalBBS
  745.         call writeln(datafile, BBS$.a.1)
  746.         call writeln(datafile, BBS$.a.2)
  747.         call writeln(datafile, BBS$.a.3)
  748.         call writeln(datafile, BBS$.a.4)
  749.         call writeln(datafile, BBS$.a.5)
  750.         call writeln(datafile, BBS$.a.6)
  751.         call writeln(datafile, BBS$.a.7)
  752.         call writeln(datafile, BBS$.a.8)
  753.         call writeln(datafile, BBS$.a.9)
  754.         call writeln(datafile, BBS$.a.10)
  755.         call writeln(datafile, BBS$.a.11)
  756.         call writeln(datafile, BBS$.a.12)
  757.         call writeln(datafile, BBS$.a.13)
  758.         call writeln(datafile, BBS$.a.14)
  759.         call writeln(datafile, BBS$.a.15)
  760.         call writeln(datafile, BBS$.a.16)
  761.       end
  762.  
  763.       call close(datafile)
  764.  
  765.         abort='Y'
  766.       end
  767.  
  768.  
  769.  
  770.       /* EDIT BBS DETAILS */
  771.       if ln='1' then do
  772.         newline
  773.  
  774.         if _ANSI = 1 then do
  775.           msg GRE'           BBS name:'OFF
  776.         end
  777.         else do
  778.         msg '           BBS name:'
  779.         end
  780.  
  781.         getline 58 normal ' '
  782.         BBS$.n.1 = result
  783.       end
  784.  
  785.       if ln='2' then do
  786.         newline
  787.  
  788.         if _ANSI = 1 then do
  789.           msg GRE'   Telephone number:'OFF
  790.         end
  791.         else do
  792.           msg '   Telephone number:'
  793.         end
  794.  
  795.         getline 58 normal ' '
  796.         BBS$.n.2 = result
  797.       end
  798.  
  799.       if ln='3' then do
  800.         newline
  801.         
  802.         if _ANSI = 1 then do
  803.           msg GRE'         Open hours:'OFF
  804.         end
  805.         else do
  806.           msg '         Open hours:'
  807.         end
  808.  
  809.         getline 58 normal ' '
  810.         BBS$.n.3 = result
  811.       end
  812.  
  813.       if ln='4' then do
  814.         newline
  815.  
  816.         if _ANSI = 1 then do
  817.           msg GRE'      Max baud rate:'OFF
  818.         end
  819.         else do
  820.           msg '      Max baud rate:'
  821.         end
  822.  
  823.         getline 58 normal ' '
  824.         BBS$.n.4 = result
  825.       end
  826.  
  827.       if ln='5' then do
  828.         newline
  829.  
  830.         if _ANSI = 1 then do
  831.           msg GRE'           Location:'OFF
  832.         end
  833.         else do
  834.           msg '           Location:'
  835.         end
  836.  
  837.         getline 58 normal ' '
  838.         BBS$.n.5 = result
  839.       end
  840.  
  841.       if ln='6' then do
  842.         newline
  843.  
  844.         if _ANSI = 1 then do
  845.           msg GRE'       BBS Software:'OFF
  846.         end
  847.         else do
  848.           msg '       BBS Software:'
  849.         end
  850.  
  851.         getline 58 normal ' '
  852.         BBS$.n.6 = result
  853.       end
  854.  
  855.       if ln='7' then do
  856.         newline
  857.  
  858.         if _ANSI = 1 then do
  859.           msg GRE'       Sysop''s name:'OFF
  860.         end
  861.         else do
  862.           msg '       Sysop''s name:'
  863.         end
  864.  
  865.         getline 58 normal ' '
  866.         BBS$.n.7 = result
  867.       end
  868.  
  869.       if ln='8' then do
  870.         newline
  871.  
  872.         if _ANSI = 1 then do
  873.           msg GRE'      Mail Networks:'OFF
  874.         end
  875.         else do
  876.           msg '      Mail Networks:'
  877.         end
  878.         
  879.         getline 58 normal ' '
  880.         BBS$.n.8 = result
  881.       end
  882.  
  883.       if ln ='9' then do
  884.         newline
  885.  
  886.         if _ANSI = 1 then do
  887.           msg GRE'        Net address:'OFF
  888.         end
  889.         else do
  890.           msg '        Net address:'
  891.         end
  892.  
  893.         getline 58 normal ' '
  894.         BBS$.n.9 = result
  895.       end
  896.  
  897.       if ln='10' then do
  898.         newline
  899.  
  900.         if _ANSI = 1 then do
  901.           msg GRE'      Email address:'OFF
  902.         end
  903.         else do
  904.           msg '      Email address:'
  905.         end
  906.  
  907.         getline 58 normal ' '
  908.         BBS$.n.10 = result
  909.       end
  910.  
  911.       if ln='11' then do
  912.         newline
  913.  
  914.         if _ANSI = 1 then do
  915.           msg GRE'Computers supported:'OFF
  916.         end
  917.         else do
  918.           msg 'Computers supported:'
  919.         end
  920.  
  921.         getline 58 normal ' '
  922.         BBS$.n.11 = result
  923.       end
  924.  
  925.       if ln='12' then do
  926.         newline
  927.  
  928.         if _ANSI = 1 then do
  929.           msg GRE'      Comment (1/3):'OFF
  930.         end
  931.         else do
  932.           msg '      Comment (1/3):'
  933.         end
  934.  
  935.         getline 58 normal ' '
  936.         BBS$.n.12 = result
  937.       end
  938.  
  939.       if ln='13' then do
  940.         newline
  941.  
  942.         if _ANSI = -1 then do
  943.           msg GRE'      Comment (2/3):'OFF
  944.         end
  945.         else do
  946.           msg '      Comment (2/3):'
  947.         end
  948.  
  949.         getline 58 normal ' '
  950.         BBS$.n.13 = result
  951.       end
  952.  
  953.  
  954.       if ln='14' then do
  955.         newline
  956.  
  957.         if _ANSI = 1 then do
  958.           msg GRE'      Comment (3/3):'OFF
  959.         end
  960.         else do
  961.           msg '      Comment (3/3):'
  962.         end
  963.  
  964.         getline 58 normal ' '
  965.         BBS$.n.14 = result
  966.       end
  967.       /* END OF EDIT */
  968.  
  969.  
  970.       /* ABORT EDIT AND DONT SAVE */
  971.       if ln='A' then do
  972.  
  973.         newline
  974.         queryn 'Realy abort edit, changes will not be saved '
  975.         confirm=upper(result)
  976.         /* ABORT THE ABORT */
  977.         if confirm ~= 'Y' then do
  978.           abort='N'
  979.         end
  980.         else do
  981.           abort='Y'
  982.         end
  983.  
  984.       end
  985.  
  986.     end
  987.  
  988.     end
  989.  
  990.   end
  991.  
  992. end
  993.  
  994. call BANNER
  995. newline 
  996.  
  997. message 'There are no more BBS records that can be edited by you.'
  998. message 'If a BBS record is incorrect please mail the Sysop.'
  999. newline
  1000. msg 'Press any key to continue'
  1001.  
  1002. getchar
  1003.  
  1004. return
  1005.  
  1006. /* ======================================================================== */
  1007.  
  1008. HELP:
  1009.  
  1010. call TEXT(help.txt)
  1011.  
  1012. return
  1013.  
  1014. /* ======================================================================== */
  1015.  
  1016. TEXT:
  1017. /* LOAD AND DISPLAY A ASCII TEXT FILE  ARGS [FILENAME] */
  1018. arg fname$
  1019.  
  1020. /* CHECK FILE EXISTS */
  1021. if exists(PATH$||fname$) then do
  1022.   l = 0
  1023.  
  1024.   /* OPEN FILE AND READ ALL LINES INTO DYNAMIC ARRAY */
  1025.   call open(ASCII_file, path$||fname$, 'r')
  1026.   /* RESET FILE POINTER TO BEGINING OF FILE */
  1027.   call SEEK(ASCII_file, 0, 'B')
  1028.  
  1029.   do until EOF(ASCII_file)
  1030.     l = l + 1
  1031.     ASCIIline$.l = readln(ASCII_file)
  1032.   end
  1033.  
  1034.   /* call close(fname$) */
  1035.   call close(ASCII_file)
  1036.  
  1037.   z=0
  1038.   x=0
  1039.   cls
  1040.   call Banner
  1041.   newline
  1042.  
  1043.   /* DISPLAY THE TEXT ONE SCREEN FULL AT A TIME */
  1044.   do a = 1 to l
  1045.     message ASCIIline$.a
  1046.     z=z+1
  1047.     x=x+1
  1048.  
  1049.     if z = dplength | x = l then do
  1050.       z = 0
  1051.       newline
  1052.       msg '                    [Return] to continue              [Q]uit'
  1053.       getchar
  1054.       erm = result
  1055.  
  1056.       /* IF 'Q' SELECTED QUIT THE LOOP */
  1057.       if upper(erm) = 'Q' then do
  1058.         a = l
  1059.       end
  1060.       /* IF MORE TEXT TO BE DISPLAYED RE-DRAW TITLE */
  1061.       else if a ~= l then do
  1062.         cls
  1063.         call Banner
  1064.         newline
  1065. /*        message a' 'l
  1066.         message ASCII_file
  1067. */
  1068.       end
  1069.  
  1070.     end
  1071.  
  1072.   end
  1073. end
  1074. else do
  1075.   /* IF FILE WASN'T FOUND DISPLAY ERROR MESSAGE AND CONTINUE */
  1076.   cls
  1077.   message '< ERROR > Can not find 'PATH$||fname$' file to load!'
  1078.   newline
  1079.   message 'Press any key'
  1080.   getchar
  1081. end
  1082.  
  1083. return
  1084.  
  1085. /* ======================================================================== */
  1086.  
  1087. BANNER:
  1088.  
  1089. CLS
  1090. if _ANSI = 1 then do
  1091.   message YEL'                    Another Pickled Fish Software Production                   '
  1092.   message OFF'                    BG ËÍ» ËÍ» ÉÍ»   Ë   Ë ÉÍ» ÉË» ÉÍ» ËÍ»'
  1093.   message CYA'                       Ì͹ Ì͹ ÈÍ»   º   º ÈÍ»  º  ÌÍ  Ì˼'
  1094.   message BLU'                       Êͼ Êͼ Èͼ   Èͼ Ê Èͼ  Ê  Èͼ ÊÈÍ V0.6'OFF
  1095.   message CYA' Channel X +44 (0)181 943 5187 'YEL'(C)1998 Ben Gaunt'CYA' Channel X +44 (0)181 943 5187 '
  1096. end
  1097. else do
  1098.   message '_____________________Another Pickled Fish Software Production__________________'
  1099.   message '                    BG  _  _  _          _  ___  __  _ '
  1100.   message '                       |_)|_)|_''  |   | |_''  |  |_  |_|'
  1101.   message '                       |_)|_)._|  |__ | ._|  |  |__ | \ V0.6'
  1102.   message '_______________________________________________________________________________'
  1103. end
  1104.  
  1105. return
  1106.  
  1107. /* ======================================================================== */
  1108.  
  1109. DISPLAYBBS:
  1110. arg zx
  1111.     if _ANSI = 1 then do
  1112.       newline
  1113.       message GRE'           BBS name: 'YEL||BBS$.zx.1
  1114.       message GRE'   Telephone number: 'OFF||BBS$.zx.2
  1115.       message GRE'         Open hours: 'OFF||BBS$.zx.3
  1116.       message GRE'      Max baud rate: 'OFF||BBS$.zx.4
  1117.       message GRE'           Location: 'OFF||BBS$.zx.5
  1118.       message GRE'       BBS Software: 'OFF||BBS$.zx.6
  1119.       message GRE'       Sysop''s name: 'OFF||BBS$.zx.7
  1120.       message GRE'      Mail Networks: 'OFF||BBS$.zx.8
  1121.       message GRE'        Net address: 'OFF||BBS$.zx.9
  1122.       message GRE'      Email address: 'OFF||BBS$.zx.10
  1123.       message GRE'Computers supported: 'OFF||BBS$.zx.11
  1124.       message GRE'            Comment: 'CYA||BBS$.zx.12
  1125.       message GRE'                     'CYA||BBS$.zx.13
  1126.       message GRE'                     'CYA||BBS$.zx.14
  1127.       message GRE'Date placed on list: 'RED||BBS$.zx.15||OFF
  1128.     end
  1129.     else do
  1130.       newline
  1131.       message '           BBS name: '||BBS$.zx.1
  1132.       message '   Telephone number: '||BBS$.zx.2
  1133.       message '         Open hours: '||BBS$.zx.3
  1134.       message '      Max baud rate: '||BBS$.zx.4
  1135.       message '           Location: '||BBS$.zx.5
  1136.       message '       BBS Software: '||BBS$.zx.6
  1137.       message '       Sysop''s name: '||BBS$.zx.7
  1138.       message '      Mail Networks: '||BBS$.zx.8
  1139.       message '        Net address: '||BBS$.zx.9
  1140.       message '      Email address: '||BBS$.zx.10
  1141.       message 'Computers supported: '||BBS$.zx.11
  1142.       message '            Comment: '||BBS$.zx.12
  1143.       message '                     '||BBS$.zx.13
  1144.       message '                     '||BBS$.zx.14
  1145.       message 'Date placed on list: '||BBS$.zx.15
  1146.     end
  1147.  
  1148. return
  1149.  
  1150. /* ======================================================================== */
  1151.  
  1152. DATLOAD:
  1153. /* SEE IF FILE EXISTS */
  1154. if exists(PATH$||'BGBBS.DAT') then do
  1155.   i=1
  1156.   n=1
  1157.   call open(datafile, PATH$||'BGBBS.DAT', 'R')
  1158.  
  1159.   do until EOF(datafile)
  1160.     BBS$.n.i = readln(datafile)
  1161.     i=i+1
  1162.     if i = 17 then do
  1163.       i=1
  1164.       n=n+1
  1165.     end
  1166.   end
  1167.  
  1168.   call close(datafile)
  1169.   totalBBS = n-1
  1170. end
  1171. else do
  1172.   msg 'No data file exists? Making a new one at > '
  1173.   msg PATH$||'BGBBS.DAT'
  1174.  
  1175.   /* OPEN DATA FILE AND ENTER DATA */
  1176.   call open(datafile, PATH$||'BGBBS.DAT', 'w')
  1177.     call writeln(datafile, 'Channel X BBS')
  1178.     call writeln(datafile, '0181 943 5187')
  1179.     call writeln(datafile, '24hrs')
  1180.     call writeln(datafile, '28800bps')
  1181.     call writeln(datafile, 'London, UK')
  1182.     call writeln(datafile, 'Xenolink')
  1183.     call writeln(datafile, 'Ben Gaunt')
  1184.     call writeln(datafile, 'Fido, Barnet etc')
  1185.     call writeln(datafile, 'N/A')
  1186.     call writeln(datafile, 'ben.gaunt@pickled.demon.co.uk')
  1187.     call writeln(datafile, 'Amiga')
  1188.     call writeln(datafile, 'An Amiga based BBS that was established in March 1995 and')
  1189.     call writeln(datafile, 'still running. Trouble connecting at 28800+ then disable')
  1190.     call writeln(datafile, 'Vfc. Whq for MiggyByte disk mag and Pickled Fish Software')
  1191.     daet$ = date()
  1192.     call writeln(datafile, daet$)
  1193.     call writeln(datafile, 'Ben Gaunt')
  1194.   call close(datafile)
  1195.  
  1196.   /* RE-READ THE DATA IN ;) */
  1197.   i=1
  1198.   n=1
  1199.   call open(datafile, PATH$||'BGBBS.DAT', 'R')
  1200.  
  1201.   do until EOF(datafile)
  1202.     BBS$.n.i = readln(datafile)
  1203.     i=i+1
  1204.     if i = 17 then do
  1205.       i=1
  1206.       n=n+1
  1207.     end
  1208.   end
  1209.  
  1210.   call close(datafile)
  1211.   totalBBS = n-1
  1212.  
  1213. end
  1214.  
  1215. return
  1216.  
  1217. /* ======================================================================== */
  1218.  
  1219. SYNTAX:
  1220. /* IF AN SYNTAX ERROR HAPPENS INFORM SYSOP */
  1221. CLS
  1222. message 'Syntax error in BGBBS...'
  1223. message 'Please inform the Sysop.'
  1224. message 'Error occured in line:' SIGL 
  1225. msg 'Press any key'
  1226. getchar
  1227. exit
  1228.